package com.foreknow.elmboot.mapper;

import com.foreknow.elmboot.po.Food;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FoodMapper {

    /**
     * 根据businessId来查询食品信息
     * @param businessId 商家Id
     * @return 食品集合
     * @throws Exception 异常外抛
     */
    @Select("select * from food where businessId=#{businessId} order by foodId")
    public List<Food> listFoodByBusinessId(Integer businessId) throws Exception;

    /**
     * 根据商家id查询食品信息
     * @param foodId
     * @return
     * @throws Exception
     */
    @Select("select * from food where foodId=#{foodId}")
    public Food foodById(Integer foodId) throws Exception;
}
